list1 = [[0, 2], [5, 10], [13, 23], [24, 25]]
list2 = [[1, 5], [8, 12], [15, 24], [25, 26]]
result = []
def practise(firstList,secondList):
   while firstList and secondList:
      if firstList[0][0]>secondList[0][1]:
         secondList.pop(0)
      elif firstList[0][1]<secondList[0][0]:
         firstList.pop(0)
      else:
         if  firstList[0][0]>secondList[0][0]:
            a=firstList[0][0]
         else:
            a=secondList[0][0]
         if firstList[0][1]<secondList[0][1]:
            b=firstList[0][1]
         else:
            b=secondList[0][1]
         result.append([a,b])
         if firstList[0][1]<secondList[0][1]:
            firstList.pop(0)
         else:
            secondList.pop(0)
   return result
print(practise(list1,list2))